<!DOCTYPE html>
<html lang="en">
<head>
	<title>{% if picker == ".up" %}换上件{% elseif picker == ".down" %}换下件{% elseif picker == ".add" %}设备信息{% endif %}
	</title>
	<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, maximum-scale=1, user-scalable=no" charset="UTF-8">
	<link rel="stylesheet" href="android_asset://css/style.css"/>
    <link rel="stylesheet" href="android_asset://css/font.css"/>
</head>
<body>
	<div class="input-upload">
		<form class="form-horizontal" id="form">
		    <input type="hidden" name="picker" value="{{picker}}" />
		  	<div class="form-group clearfix bortno">
		  		<div class="content">
			    	<label  class="left control-label">设备名</label>
			   		<div class="right">
			    		<input type="text" id="name" name="name" class="form-control padright" placeholder="填写设备名称"><a class="a_href" href="javascript:#"><i></i></a></a>
			    	</div>
			    </div>
		  	</div>
		  	<div class="form-group clearfix">
		  		<div class="content">
			    	<label  class="left control-label">PartNo</label>
			    	<div class="right">
				    	<input type="text" name="id" id="partNo" class="form-control"  placeholder="填写PartNo.或点击图标扫描">
				    	<a href="javascript:msAndroid.scanCode('#partNo')"><i class="icon-scan"></i></a>
			    	</div>
			    </div>
		  	</div>
		  	<div class="form-group clearfix">
		  		<div class="content">
			    	<label  class="left control-label">FurNo</label>
			    	<div class="right">
				     	<input type="text" name="fru" id="furNo" class="form-control" placeholder="填写FurNo.或点击图标扫描">
				     	<a href="javascript:msAndroid.scanCode('#furNo')"><i class="icon-scan"></i></a>
			    	</div>
			    </div>
		  	</div>
		    
		  	<div class="form-group leo">
		  		<div class="content">
			    	<label class="control-label">备注</label>
			    	<div class="describe"> 
						<textarea name="description" cols="30" rows="5" style="width:100%"></textarea>
			    	</div>
			    </div>
		  	</div>
		</form>

		<div class="confirm">
			<button type="button" class=""><a href="#">确认</a></button>
		</div>
	</div>
</body>
<script src="android_asset://jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="android_asset://jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="android_asset://bridge.js" type="text/javascript"></script>
<script src="android_asset://android.js" type="text/javascript"></script>
<script type="text/javascript">
    $(".confirm button").click(function(){
    	//验证设备名非空和过长
		if($.trim($("#name").val()).length==0||$("#name").val().length>36){
			 msAndroid.toast("填写设备名称的字数在1~36字之间");
			 return ;
		}
		//验证设备名非空和过长
		if($.trim($("#partNo").val()).length==0||$("#partNo").val().length>36){
			 msAndroid.toast("填写partNo的字数在1~36字之间");
			 return ;
		}
    	
    	var json=msAndroid.serializeObject("#form");
    	msAndroid.transferData("deviceInput",json);
    });
</script>
</html>